<?php
// ====================================

// Author:            韩孝龙
// Email:             18301805881@163.com
// Created Time:      2020-11-06 17:18:22
// Description:

// ====================================

spl_autoload_register(function ($className) {
    $dirName = [
        '',
        'class',
	'config',
	'dao',
        'service',
        'tool',
    ];

    foreach ($dirName as $v) {
        if (empty($v)) {
            $fileName = __DIR__ . '/' . $className . '.php';
        } else {
            $fileName = __DIR__ . '/' . $v . '/' . $className . '.php';
        }

        if (file_exists($fileName)) {
            require $fileName; // 架构
            break;
        }
    }
});
